{#{% extends "base.html" %}#}
{#{% load static %}#}
{#{% block main %}#}
<head>
    <link href="../static/css/bk.css" rel="stylesheet">
    <script type="text/javascript">

        $(document).ready(function () {
            $(".table tbody td:nth-child(1):lt({{ finished_num }})").css('color', 'red');
            {% if province_flag %}
                $('.table tbody tr:nth-child(14)  td:nth-child(1)').css('color', 'red');
            {% endif %}
            tb = document.getElementById('compete_table')
            customColSpan(tb, 1, 14)
            autoRowSpan(tb, 0, 0)
            {#autoRowSpan(tb, 0, 1)#}
            {#合并全省数据#}

            {#添加属性#}
            $('#compete_table > tbody > tr:nth-child(14) > td:nth-child(1)').attr('colSpan', 3)
            $('#compete_table > tbody > tr:nth-child(14) > td:nth-child(1)').text('全省')
            {#$('#compete_table > tbody > tr:nth-child(14) > td:nth-child(1)').css('width', "200%")#}
            $('#compete_table > tbody > tr:nth-child(14) > td:nth-child(1)').css('table-layout', "fixed")

        })
        {#自动合并相同行#}

        function autoRowSpan(tb, row, col) {

            var lastValue = "";
            var value = "";
            var pos = 1;
            for (var i = row; i < tb.rows.length; i++) {
                value = tb.rows[i].cells[col].innerText;
                console.log(value)
                if (lastValue == value) {
                    tb.rows[i].deleteCell(col);
                    {#第二列，不用可删除#}
                    tb.rows[i].deleteCell(col);
                    tb.rows[i - pos].cells[col].rowSpan = tb.rows[i - pos].cells[col].rowSpan + 1;
                    {#第二列，不用可删除#}
                    tb.rows[i - pos].cells[col + 1].rowSpan = tb.rows[i - pos].cells[col].rowSpan;
                    {#tb.rows[i - pos].cells[col+1].rowSpan = tb.rows[i - pos].cells[col+1].rowSpan + 1;#}
                    pos++;
                } else {
                    lastValue = value;
                    pos = 1;
                }
            }
        }

        function customColSpan(tb, col, row) {
            {#alert(tb.rows[row].cells[col-1].innerHTML)#}
            {#删掉指定                #}
            tb.rows[row].deleteCell(0);
            tb.rows[row].deleteCell(1);
            {#合并单元格#}
            {#tb.rows[row].cells[col - 1].style.colSpan = "2";#}
            {#alert(tb.rows[row].cells[col - 1].colSpan)#}

        }
        ;
    </script>
</head>
<div class='yb-main' style="width: 680px">
    {#        <h3 style="margin-bottom: 2px; color:yellow">{{ show_time.month }}月份每日平台达成追踪({{ show_time.month }}月{{ show_time.day }}日)</h3>#}
    {#        <h3 style="margin-bottom: 2px; color:yellow">&nbsp;四月份三年期业务日平台({{ show_time.month }}月{{ show_time.day }}日)</h3>#}
    <h3 style="margin-bottom: 2px; color:yellow">&nbsp;阶段对抗情况通报<font size="2">（5月8日-12日）&nbsp;&nbsp;(单位：万元)</font></h3>
    {#        <p style="margin-bottom: 2px;color: yellow">{{ show_time.time }}&nbsp;&nbsp;单位：万元</p>#}
    {#        <p style="margin-bottom: 2px;color: yellow;text-align: right">{{ show_time.time }}本战报仅供业务追踪参考&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</p>#}
    {% autoescape off %}
        {{ html }}
    {% endautoescape %}
    <p id="day-comment">
        {% autoescape off %}
            {{ comment }}
        {% endautoescape %}
    </p>
</div>

{#{% endblock %}#}
{##}